/**
* @author AlbertDarren
* @contact 2563491540@qq.com
*/
#include <cstdio>
#include <algorithm>
using namespace std;
struct Moncake
{
    double number;
    double prices;
    double pricesByNumber;
} cake[1001];
bool cmp(Moncake a,Moncake b)
{
    return a.pricesByNumber>b.pricesByNumber;
}
int main_1020()
{
    int n,D;
    scanf("%d%d",&n,&D);
    for (int i=0;i<n ;++i )
    {
        scanf("%lf",&cake[i].number);
    }
    for (int i=0;i<n ;++i )
    {
        scanf("%lf",&cake[i].prices);
        cake[i].pricesByNumber=cake[i].prices/cake[i].number;
    }
    sort(cake,cake+n,cmp);
    double money=0.0;
    for (int i=0;i<n ;++i )
    {
        if (cake[i].number>=D)
        {
            money+=D*cake[i].pricesByNumber;
            break;
        }
        else
        {
            money+=cake[i].number*cake[i].pricesByNumber;
            D-=cake[i].number;
        }
    }
    printf("%.2lf",money);
	return 0;
}
